<template>
	<view class="box">
		<uNavbar title="订单详情" ></uNavbar>
		<!--我接收的 -->
		<view class="address flex_ld">
			<view class="address_l flex_dq">
				<image src="../../static/icon/i_diz.png" mode="aspectFill"></image>
				<view class="dizhi flex_Z">
					<text>{{info.province+info.city+info.area+info.address}}</text>
					<text>{{info.buy_name}} {{info.phone}}</text>
				</view>
			</view>
		</view>

		<view class="main" v-for="(item,index) in shopGoodsList" :key="index" >
			<view class="main_from_top">
				<image :src="item.spec_thumb" mode="aspectFill"></image>
				<view class="name">
					{{item.goods_name}}
				</view>
				<view class="text">
					{{item.spec_name}}
				</view>
				<view class="price">
					{{item.price}}
				</view>
				<view class="text1">
					X{{item.nums}}
				</view>
				<!-- <view class="price">
					<image v-if="info.pay_type==3 ||info.pay_type==6" src="../../static/icon/i_money.png" mode=""></image>
					<image v-if="info.pay_type==4" src="../../static/icon/i_ys.png" mode=""></image>
					<image v-if="info.pay_type==5" src="../../static/icon/i_ful.png" mode=""></image>
					{{ info.pay_type==5 ?(item.goods.price/proportion).toFixed(6):item.goods.price}}
				</view> -->
			</view>
<!-- 			<view class="main_btn_wrap">
				<view class="zz_btn">
					转赠
				</view>
				<view class="gm_btn">
					挂卖
				</view>
			</view> -->
		</view>

		<view class="main_from">
			<view class="main_from_bottom">
				<view class="title">
					订单信息
				</view>
				<view class="main_from_bottom_item">
					<text style="color: ##A7A4AD;">订单编号</text>
					<text>{{info.order_sn}}</text>
				</view>
				<view class="main_from_bottom_item">
					<text style="color: #A7A4AD;">订单状态</text>
					<text>{{info.status_desc}}</text>
				</view>
				<view class="main_from_bottom_item">
					<text style="color: #A7A4AD;">订单金额</text>
					<view>
					
					<text style="color: #A68A64;" >{{ info.pay_type==5 ?(info.pay_price/proportion).toFixed(6):info.total_price}}</text>
					</view>
				</view>
		
				<view class="main_from_bottom_item">
					<text style="color: #A7A4AD;">折扣金额</text>
					<view>
					
					<text style="color: #A68A64;" >{{ info.pay_type==5 ?(info.pay_price/proportion).toFixed(6):info.discount_price}}</text>
					</view>
				</view>
				<view class="main_from_bottom_item">
					<text style="color: #A7A4AD;">实付金额</text>
					<view>
						<image v-if="info.pay_type==3" style="width: 24rpx;height: 24rpx;margin-right: 4rpx;" src="/static/icon/fhtb.png" mode=""></image>
						<image v-if="info.pay_type==4" style="width: 30rpx;height: 20rpx;margin-right: 4rpx;" src="/static/image/fhyb.png" mode=""></image>
						<image v-if="info.pay_type==5" style="width: 24rpx;height: 24rpx;margin-right: 4rpx;" src="/static/icon/i_ful.png" mode=""></image>
						<image v-if="info.pay_type==7" style="width: 30rpx;height: 30rpx;margin-right: 4rpx;" src="../../static/icon/i_integral.png" mode=""></image>
						<text style="color: #A68A64;" v-if="info.pay_type==8 ||info.pay_type==9">￥</text>
					<text style="color: #A68A64;" >{{ info.pay_type==5 ?(info.pay_price/proportion).toFixed(6):info.pay_price}}</text>
					
					</view>
				</view>
				<view class="main_from_bottom_item" v-if="info.order_type==4">
					<text style="color: #A7A4AD;">赠送DAO贡献值</text>
					<view>
					
					<text style="color: #A68A64;" >{{info.dao_contribution}}</text>
					</view>
				</view>
				<view class="main_from_bottom_item">
					<text style="color: #A7A4AD;">订单创建时间</text>
					<text>{{info.create_time}}</text>
				</view>
				<view class="main_from_bottom_item">
					<text style="color: #A7A4AD;">付款方式</text>
					<view class="flex_dq  f28" style="color: #A7A4AD;">
						<text  >{{info.pay_type_desc}}</text>
						<view v-if="info.zh_balance_amount&&info.pay_type==6">
							：<image  style="width: 24rpx;height: 24rpx;margin-right: 8rpx;" src="/static/icon/i_money.png" mode=""></image>
							<text>{{info.zh_balance_amount}} </text>
						</view>
						<view v-if="info.zh_balance_amount&&info.pay_type==6">
							<text style="margin: 0 10rpx ;">+</text>
							<image style="width: 24rpx;height: 24rpx;margin-right: 8rpx;" src="/static/image/fhyb.png" mode=""></image>
							<text>{{info.zh_balance_hf_amount}} </text>
						</view>
					</view>
				</view>
				<view class="main_from_bottom_item">
					<text style="color: #A7A4AD;">订单类型</text>
					<text>{{info.order_type_desc}}</text>
				</view>
				<view class="main_from_bottom_item" v-if="info.is_integral">
					<text style="color: #A7A4AD;">赠送方式</text>
					<text>{{info.is_integral_desc}}</text>
				</view>
				<view class="main_from_bottom_item"  v-if="info.status>=2 && shopGoodsList[0].express_number!=''">
					<text style="color: #A7A4AD;">快递公司</text>
					<text >{{shopGoodsList[0].express_name}}</text>
				</view>
				<view class="main_from_bottom_item"  v-if="info.status>=2 && shopGoodsList[0].express_number!=''">
					<text style="color: #A7A4AD;">快递单号</text>
					<text>{{shopGoodsList[0].express_number}}</text>
				</view>
				<view class="main_from_bottom_item" >

					<text style="color: #A7A4AD;">宝箱充能点数(收货后增加)</text>
					<text>{{info.charging_points}}</text>
				</view>
			</view>
		</view>
		<view class="wraps" v-if="expressData">
			<view class="wrapstop">
				物流信息
			</view>
			
			<view class="wrapsn">
				<u-steps :current="expressData.length" direction="column" activeColor="#A68A64">
						<u-steps-item v-for=" (item,index) in expressData" :key="index"  :title="item.AcceptStation" :desc="item.AcceptTime">
						</u-steps-item>
					</u-steps>
			</view>
		</view>
		<view style="width: 750rpx;height: 40rpx;">
			
		</view>
	</view>

</template>

<script>
	import {orderDetails} from "../../api/shopp.js"
	export default {
		data() {
			return {
				id:"",
				proportion:'',//比例
				info:{},
				shopGoodsList:[],
				expressData:[]
			}
		},
		onLoad(options) {
			console.log(options)
			this.id=options.id
			this.getinfo()
		},
		methods: {
			getinfo(){
				orderDetails({
					order_id:this.id
				}).then(res=>{
					if (res.code == 1) {
						this.info=res.data
						this.shopGoodsList = res.data.shop_order_goods
						this.expressData = res.data.express_data
						this.proportion = res.data.ufl_rmb_prop
						console.log(this.info,"详情1")
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.box {
		width: 750rpx;
		height: 100vh;
		background: #E0DDDA;
		position: relative;
	}
	/deep/.u-steps-item__wrapper{
		background-color: #F2F2F2 !important;
	}
	.wraps{
		width: 690rpx;
		min-height: 148rpx;
		background: #F2F2F2;
		border-radius: 12rpx 12rpx 12rpx 12rpx;
		margin: 0 auto;
		margin-top: 20rpx;
	}
	.wrapstop{
		font-weight: 400;
		font-size: 32rpx;
		color: #333333;
		padding-top: 20rpx;
		margin-left: 30rpx;
	}
	.wrapsn{
		width: 90%;
		margin: 0 auto;
	}
	.address {
		width: 690rpx;
		margin: 0 auto;
		height: 100rpx;
		background: #F2F2F2;
		border-radius: 12rpx;
		margin-top: 10rpx;
		padding: 0 24rpx;
	}
	
	.address_l {
		font-size: 30rpx;
		color: #3D3D3D;
	}
	
	.address_l>image {
		width: 40rpx;
		height: 40rpx;
		margin-right: 16rpx;
	}
	
	.dizhi>text:nth-child(1) {
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 1;
		overflow: hidden;
	}
	
	.main_from {
		width: 690rpx;
		// height: 472rpx;
		background: #F2F2F2;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		margin: 0 auto;
		margin-top: 40rpx;

		
		.main_from_bottom{
			width: 630rpx;
			// height: 420rpx;
			margin: 0 auto;
			display: flex;
			flex-direction: column;
			justify-content: space-around;
			.title{
				margin-top: 16rpx;
				font-size: 32rpx;
				color: #333;
				margin-bottom: 12rpx;
			}
			.main_from_bottom_item{
				display: flex;
				justify-content: space-between;
				margin-bottom: 10rpx;
				align-items: center;
				>text{
					font-size: 26rpx;
					color: #A7A4AD;
				}
			}
		}
	}
	.main{
		width: 690rpx;
		height: 224rpx;
		background: #F2F2F2;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		margin: 0 auto;
		margin-top: 30rpx;
	}
	.main_from_top {
		margin: 0 auto;
		width: 630rpx;
		height: 220rpx;
		// border-bottom: 2rpx solid rgba(216, 216, 216, 0.1);
		position: relative;
		background-color: #F2F2F2;
		// border-radius: 16rpx 16rpx 16rpx 16rpx;
		>image {
			width: 154rpx;
			height: 154rpx;
			border-radius: 20rpx 20rpx 20rpx 20rpx;
			margin-top: 30rpx;
		}
	
		.name {
			width: 460rpx;
			position: absolute;
			top: 36rpx;
			left: 192rpx;
			font-weight: 400;
			font-size: 32rpx;
			color: #333;
			white-space: nowrap;
			/* 不换行 */
			overflow: hidden;
			/* 超出部分隐藏 */
			text-overflow: ellipsis;
			/* 显示省略号 */
		}
		.text{
			width: 460rpx;
			height: 70rpx;
			position: absolute;
			top: 86rpx;
			left: 192rpx;
			font-weight: 400;
			font-size: 24rpx;
			color: #A6A5AF;
			// white-space: nowrap;
			// /* 不换行 */
			// overflow: hidden;
			// /* 超出部分隐藏 */
			// text-overflow: ellipsis;
			/* 显示省略号 */
		}
		.price{
			
		}
		.text1{
			width: 260rpx;
			position: absolute;
			top: 150rpx;
			right: 20rpx;
			font-weight: 400;
			font-size: 24rpx;
			color: #A6A5AF;
			white-space: nowrap;
			/* 不换行 */
			overflow: hidden;
			/* 超出部分隐藏 */
			text-overflow: ellipsis;
			text-align: right;
			/* 显示省略号 */
		}
		.price {
			position: absolute;
			top: 140rpx;
			left: 192rpx;
			display: flex;
			align-items: center;
			>image{
				width: 28rpx;
				height: 28rpx;
				margin-right: 6rpx;
			}
			font-size: 32rpx;
			color: #A68A64;
		}
		.tag_wrap{
			width: 300rpx;
			position: absolute;
			top: 146rpx;
			left: 192rpx;
			font-weight: 400;
			font-size: 24rpx;
			color: #A6A5AF;
			white-space: nowrap;
			/* 不换行 */
			overflow: hidden;
			/* 超出部分隐藏 */
			text-overflow: ellipsis;
			display: flex;
			/* 显示省略号 */
			.tag{
				width: 64rpx;
				height: 36rpx;
				background: linear-gradient( 90deg, #AB8E68 0%, #D7BA93 100%);
				border-radius: 6rpx 6rpx 6rpx 6rpx;
				font-size: 22rpx;
				color: #FFFFFF;
				text-align: center;
				line-height: 36rpx;
			}
			.tag_num{
				width: 150rpx;
				height: 36rpx;
				background: #DAD1C6;
				border-radius: 6rpx 6rpx 6rpx 6rpx;
				text-align: center;
				line-height: 36rpx;
				font-size: 24rpx;
				color: #FFFFFF;
			}

		}
		.tip{
			position: absolute;
			top: 74rpx;
			right: 0rpx;
			font-size: 36rpx;
			color: #FF2CDF;
		}
	}
	.main_btn_wrap{
		width: 630rpx;
		height: 100rpx;
		margin: 0 auto;
		display: flex;
		align-items: center;
		justify-content: flex-end;
		.zz_btn{
			width: 122rpx;
			height: 52rpx;
			border-radius: 536rpx 536rpx 536rpx 536rpx;
			border: 2rpx solid #A6A5AF;
			font-size: 26rpx;
			color: #A7A4AD;
			text-align: center;
			line-height: 52rpx;
		}
		.gm_btn{
			width: 122rpx;
			height: 52rpx;
			border-radius: 536rpx 536rpx 536rpx 536rpx;
			border: 2rpx solid #FF2CDF;
			font-size: 26rpx;
			color: #FF2CDF;
			text-align: center;
			line-height: 52rpx;
			margin-right: 30rpx;
			margin-left: 30rpx;
		}
		
	}
</style>